// Modal.vue 弹框组件
<template>
    <div class="modal-mask">
        <div class="modal">
            <div class="modal-content">
                <span class="close" @click="close">&times;</span>
                <ul>
                    <li v-for="item in data" :key="item.id">
                        {{ item.siteName }} - {{ item.maxLiquidLevel }}
                    </li>
                </ul>
            </div>
        </div>
    </div>
</template>

<script>
export default {
    props: ['data'],
    methods: {
        close() {
            this.$emit('close')
        }
    }
}
</script>

<style scoped>
.modal-mask {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.modal {
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    max-width: 80%;
    max-height: 80%;
    overflow-y: auto;
    position: relative;
    text-align: center;
    background-color: #fff;
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.close {
    position: absolute;
    top: 10px;
    right: 10px;
    cursor: pointer;
    color: #888;
    font-size: 30px;
    transition: color 0.3s;
}

.close:hover {
    color: #555;
}

.modal-content {
    line-height: 1.6;
    color: #666;
    margin-bottom: 20px;
}
/* 调整数据间的间距 */
.modal-content ul {
    padding: 0;
    margin: 10px 0; /* 增加上下间距 */
}

/* 其他样式 */
</style>
